package com.jedi;

import java.util.ArrayList;
import java.util.List;

import com.tss.util.DbConn;
import com.tss.util.DbRs;

public class UserroleMgr extends BaseObj{
	
	
	public List get() {
		clearErr();
		DbConn conn = new DbConn();
		DbRs rs = null;
		try {
			String sql = "select * from userrole where 1=1 ";
			
			conn.prepare(sql);
			rs = conn.executeQuery();
		}
		catch(Exception ex) {
			ex.printStackTrace();
			setErr(ex.getMessage());
			return null;
		}
		finally {
			conn.close();
		}
		if (rs != null && rs.size() >0) {
			List r = new ArrayList();
			for(int i=0;i<rs.size();i++) {
				Userrole power = new Userrole();
				power.setUser_id(get(rs,i,"user_id"));
				power.setRole_id(get(rs,i,"role_id"));
				r.add(power);
			}
			return r;
		}
		return null;
	}

}
